package edu.thu.studio.ormdesigner.editor.dialog;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.gef.EditPartViewer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;

import edu.thu.studio.ormdesigner.common.ValidatableTabWrapper;
import edu.thu.studio.ormdesigner.editor.dialog.tab.table.ColumnTabWrapper;
import edu.thu.studio.ormdesigner.editor.dialog.tab.table.GeneralTabWrapper;
import edu.thu.studio.ormdesigner.model.orm.table.Table;
import edu.thu.studio.ormdesigner.util.Properties;

public class TableDialog extends NodeDialog {
    
    private Table ormTable;
    
    public TableDialog(Shell parentShell, EditPartViewer viewer, Table ormTable) {
        super(parentShell, viewer);
        this.ormTable = ormTable;
    }
    
    @Override
    protected List<ValidatableTabWrapper> createTabWrapperList(TabFolder tabFolder) {
        List<ValidatableTabWrapper> list = new ArrayList<ValidatableTabWrapper>();
        list.add(new GeneralTabWrapper(this, tabFolder, ormTable));
        list.add(new ColumnTabWrapper(this, tabFolder, ormTable));
        return list;
    }
    
    @Override
    protected String getTitle() {
        return Properties.diagram_label_table;
    }
    
}
